
import React from 'react'
import { Route } from 'react-router-dom'
import LeftNavigator from './left-navigator.js'


const ConfigRouter = ({ component: Component, ...rest }) => (
    <Route {...rest} render={props => (
        <Component {...rest} />
    )} />
)


class TableController extends React.Component {
    // constructor(props) {
    //     super(props);

    //     // this.props.routers
    // }

    render() {
        return (
            <div>
                {/* 导航组件 */}
                <LeftNavigator routerConfig={this.props.routes} /> {/* 右边详情 */}
                <div className="left-container">
                    {/*------------- 路由 -------------*/}
                    {this.props.routes.map((route, i) => (
                        <ConfigRouter key={i} {...route} />
                    ))}

                </div>

            </div>
        )
    }
}

export default TableController;